package ai.people.netmon.framework.exception.enums;

/**
 * 常见异常枚举
 *
 * @author yuanqinglong
 * @date 2022/2/15 17:07
 */
public enum CommonEnum implements ExceptionEnum {
    FAIL(false, 400, "操作失败！"),
    SUCCESS(true, 200, "操作成功！"),
    SERVER_ERROR(false, 500, "抱歉，系统繁忙，请稍后重试！"),
    QUERY_NOT_FOUND(true, 100007, "数据不存在！"),
    CHECK_NOT_EMPTY_PRIMARY_ID(false, 100008, "ID不能为空！"),
    REQUEST_METHOD_TYPE_ERROR(false, 100009, "方法不支持"),
    DATA_CONVERSION_EXCEPTION(false, 100010, "数据转换异常"),
    ACCESS_SERVICE_DOES_NOT_EXIST(false, 100011, "访问服务不存在"),
    UNSUPPORTED_MEDIA_TYPE(false, 100012, "不支持的媒体类型"),
    SERVICE_IS_STARTING(false, 100013, "服务暂时不可用、请稍后再试！"),
    CONFIGURATION_ERROR(false, 100014, "配置错误！"),
    OPT_NOT_SUPPORT(false, 100015, "操作不支持！")
    ;


    /**
     * 状态
     */
    final boolean status;
    /**
     * 代码
     */
    final int code;
    /**
     * 消息
     */
    final String message;

    CommonEnum(boolean status, int code, String message) {
        this.status = status;
        this.code = code;
        this.message = message;
    }


    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }

    @Override
    public boolean getStatus() {
        return this.status;
    }
}
